package m10;

import static org.junit.Assert.*;

import org.junit.Test;

import m07.Good;
import m07.Ship;

/**
 * This tests to see if the removeCargo method is working as it should.
 * 
 * @author Joshua Clark
 * @version 1.0 16 November 2012
 */
public class RemoveCargoTest {

	/** This is a good object of type Water */
	Good g00 = new Good ("Water", 0, 0, 30, 3, 4, "LOTSOFWATER", "DESERT", 30, 50, 0);
	/** This is a good object of type Furs */
	Good g01 = new Good ("Furs", 0, 0, 250, 10, 10, "RICHFAUA", "LIFELESS", 230, 280, 0);
	/** This is a good object of type Food */
	Good g02 = new Good ("Food", 1, 0, 100, 5, 5, "RICHSOIL", "POORSOIL", 90, 160, 0);
	/** This is a ship object of type Flea */
	Ship ship = new Ship("Flea", 10);

	@Test
	public void checkRemoveGood() {
		/* Initial check to see that there is nothing in the cargo bay. */
		assertFalse(ship.contains("Water"));
		assertFalse(ship.contains("Furs"));
		assertFalse(ship.contains("Food"));
		
		/* Adds the objects to the cargo bay. */
		ship.addCargo(g00);
		ship.addCargo(g01);
		ship.addCargo(g02);
		
		/* Secondary check to see that the objects were added to the cargo bay. */
		assertTrue(ship.contains("Water"));
		assertTrue(ship.contains("Furs"));
		assertTrue(ship.contains("Food"));
		assertTrue(ship.getSpaceUsed() == 3);
		
		/* Removes the objects from the cargo bay. */
		ship.removeCargo("Water");
		ship.removeCargo("Furs");
		ship.removeCargo("Food");
		
		/* Final check to see that the objects were deleted from the cargo bay. */
		assertFalse(ship.contains("Water"));
		assertFalse(ship.contains("Furs"));
		assertFalse(ship.contains("Food"));
	} // end method checkRemoveGood

} // end class
